
{% extends "synapse/base.html" %}
{% block stylesheets %}
        <link rel="stylesheet" type="text/css" href="/media/css/jquery.autocomplete.css">
        {{ block.super }}
{% endblock %}

{% block js_libraries %}
        <script type="text/javascript" src="/media/js/jquery-1.2.1.js"></script>

        <script type="text/javascript" src="/media/js/jquery.bgiframe.js"></script>

        <script type="text/javascript" src="/media/js/jquery.dimensions.js"></script>

        <script type="text/javascript" src="/media/js/jquery.autocomplete.js"></script>
        
        <script type="text/javascript" src="/media/js/jquery.expander.js"></script>

        <script type="text/javascript">
        $(document).ready(function() {

            function formatItem(row) {

                //var row = row.split("|");

                return row[0];

            }

            function formatResult(row) {

                return row[0];

            }

            $('#id_author').autocomplete('/ac/authors/',{matchContains: false, formatResult: formatResult, formatItem: formatItem, matchCase: false, selectFirst: false, multiple: true, multipleSeparator: '; ', autoFill: true, delay: 300, minChars: 2, scroll: false });

            function populateElement(selector, defvalue) {

                if($(selector).attr('value') == null) {

                    $(selector).attr('value', defvalue);

                }

              

                $(selector).focus(function() {

                    if($(selector).attr('value') == defvalue) {

                        $(selector).attr('value', '');

                    }

                });

                

                $(selector).blur(function() {

                    if($(selector).attr('value') == null || $(selector).attr('value') == "") {

                        $(selector).attr('value', defvalue);

                    }

                });

            }

            populateElement('#id_author', 'Last Name, First');
            
            $('div.expandable p').expander({
                userCollapseText: 'less...'
                });
            
        });

        </script>

{% endblock %}

{% block content %}

    <!-- START: announcements -->
   {% if announcement %}<div id="announcements"><div id="ann_title">{{ announcement.title }}<br><span id="ann_date">{{ announcement.pub_date|date:"M j Y h:i A" }}</span></div><p>{{ announcement.body|safe }}</p></div> {% endif %}
    <!-- END: announcements -->
    <!-- START: messages -->
    {% if msg %}<div><h2 id="message">{{ msg|safe }}</h2><br><br></div>{% endif %}

        <h2><span class="Synapse_name">Synapse</span> News Feeds</h2>
        <p>Be notified the minute a new item is added to <span class="Synapse_name">Synapse</span> with any of the news feeds listed below. To monitor these feeds, please make sure that you are using a current version of your browser (Internet Explorer 7.0 or later, Firefox 2.0 or later, or Safari 2.0 or later). Earlier browser versions may not work. If you do not know how to set up feed monitoring, then you might want to <a href="/about/newsfeeds/">learn more about news feeds.</a></p>
	<!-- START: searchForm -->

	   <h3>Author Citations Feeds</h3>
			<div class="expandable">
            <p>Author feeds provide all citations in <span class="Synapse_name">Synapse</span> for one or more authors, and will update automatically when new citations by the author(s) are added to the database. Use the search form below to find the feed for an author or authors.</p>
            </div>
	{% if results %}
	<div id="feedSearchResults">
	<h3>Your Results: Individual Author News Feed</h3>
        <table class="feeds">
            <thead>
            <tr>
                <td>Author Feed</td>
                <td>URL</td>
                <td>&nbsp;</td>
            </tr>
            </thead>
            <tbody>
                {% for result in results %}
                <tr>
                    <td><a href="/feeds/author/{{ result.id }}/" title="Your Results: Feed for {{ result.first_name }} {{ result.last_name }}">{{ result.first_name }} {{ result.last_name }}</a></td>
                    <td><a href="/feeds/author/{{ result.id }}/" title="Your Results: Feed for {{ result.first_name }} {{ result.last_name }}">http://synapse.mskcc.org/feeds/author/{{ result.id }}/</a></td>
                    <td><a href="/feeds/author/{{ result.id }}/" title="Your Results: Feed for {{ result.first_name }} {{ result.last_name }}"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
	</div>
	{% endif %}
	{% if combined_url %}
	<div id="combinedFeedSearchResults">
	<h3>Your Results: Combined Authors News Feed</h3>
        <table class="feeds">
        <thead>
        <tr>
            <td>Combined Authors Feed</td>
            <td>URL</td>
            <td>&nbsp;</td>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td><a href="/feeds/author/{{ combined_url }}/" title="Combined Feed for authors">Combined Feed</a></td>
                <td><a href="/feeds/author/{{ combined_url }}/" title="Combined Feed for authors">http://synapse.mskcc.org/feeds/author/{{ combined_url }}/</a></td>
                <td><a href="/feeds/author/{{ combined_url }}/" title="Combined Feed for authors"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
            </tr>
        </tbody>
    </table>

	</div>
	<br>
	{% endif %}
	<div id="feedSearchForm">

			<form id="feed_search_form" method="post" action="/newsfeeds/search/">
                <table class="feeds">
                    <thead>
                    <tr>
                        <td>Author Search</td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>{{ form.author }}<br><span class="subtle">{% autoescape off %}{{ form.author.help_text }}{% endautoescape %}</span></td>
                        {% if form.author.errors %}<td>{{ form.author.errors }}</td>{% endif %}
                    </tr>
                    <tr>
                    <td>
                    <input type="submit" value="    Search    ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="    Clear    ">
                    </td>
                    </tr>
                    </tbody>
                </table>
<!--
				<div class="clearLeft">&nbsp;</div>
				<div class="clearBoth"><p><input type="submit" value="    Search    ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="    Clear    "></p><br></div>
-->
			</form>

	</div>
        
        <h3>Latest Citations Feed</h3>
        <div class="expandable">
        <p>The <a href="/feeds/latest/" rel="feed">Latest Citations</a> feed provides citations for all documents added to <span class="Synapse_name">Synapse</span> within the last seven days. If the resulting page does not have any citations, paste the web address into your reader anyway, and you will receive new citations next time <span class="Synapse_name">Synapse</span> is updated.</p>
        </div>
           <table class="feeds">
	           <thead>
	               <tr>
                       <td>Feed Type</td>
                       <td>URL</td>
                       <td>&nbsp;</td>
                    </tr>
	           </thead>
	           <tbody>
	               <tr>
	                   <td><a href="/feeds/latest/">Latest Citations</a></td>
	                   <td><a href="/feeds/latest/">http://synapse.mskcc.org/feeds/latest/</a></td>
	                   <td><a href="/feeds/latest/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	           </tbody>
	       </table>

	   <h3>News Feeds by Document Type</h3>
	   <p>Below we offer newsfeeds for each type of document.  </p>
	       <table class="feeds">
	           <thead>
	               <tr>
                       <td>Feed Type</td>
                       <td>URL</td>
                       <td>&nbsp;</td>
                    </tr>
	           </thead>
	           <tbody>
	               <tr>
	                   <td><a href="/feeds/doctype/article/">Articles</a></td>
	                   <td><a href="/feeds/doctype/article/">http://synapse.mskcc.org/feeds/doctype/article/</a></td>
	                   <td><a href="/feeds/doctype/article/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/book/">Books</a></td>
	                   <td><a href="/feeds/doctype/book/">http://synapse.mskcc.org/feeds/doctype/book/</a></td>
	                   <td><a href="/feeds/doctype/book/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/book_chapter/">Book Chapters</a></td>
	                   <td><a href="/feeds/doctype/book_chapter/">http://synapse.mskcc.org/feeds/doctype/book_chapter/</a></td>
	                   <td><a href="/feeds/doctype/book_chapter/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/conference_paper/">Conference Papers</a></td>
	                   <td><a href="/feeds/doctype/conference_paper/">http://synapse.mskcc.org/feeds/doctype/conference_paper/</a></td>
	                   <td><a href="/feeds/doctype/conference_paper/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/editorial/">Editorials</a></td>
	                   <td><a href="/feeds/doctype/editorial/">http://synapse.mskcc.org/feeds/doctype/editorial/</a></td>
	                   <td><a href="/feeds/doctype/editorial/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/review_article/">Review Articles</a></td>
	                   <td><a href="/feeds/doctype/review_article/">http://synapse.mskcc.org/feeds/doctype/review_article/</a></td>
	                   <td><a href="/feeds/doctype/review_article/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	               <tr>
	                   <td><a href="/feeds/doctype/short_survey/">Short Surveys</a></td>
	                   <td><a href="/feeds/doctype/short_survey/">http://synapse.mskcc.org/feeds/doctype/short_survey/</a></td>
	                   <td><a href="/feeds/doctype/short_survey/"><img src="/media/images/feed.png" alt="Newsfeed Icon" width="16" height="16"></a></td>
	               </tr>
	           </tbody>
	       </table>
    </div>

	<!-- END: searchForm -->
{% endblock %}

